import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
const store = new Vuex.Store({
    state: {
        token: localStorage.getItem("flow_token"),
        userId: localStorage.getItem("flow_userId"),
        comId: localStorage.getItem("flow_comId"), //全局单位id
    },
    getters: {},
    mutations: {
        set(state, payload) {
            for (var key in payload) {
                if (payload.hasOwnProperty(key)) {
                    state[key] = payload[key];
                }
            }
        },
    },
    actions: {},
    modules: {},
});

//导出store
export default store;
